home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 7
/
Amiga Format AFCD07 (Dec 1996, Issue 91).iso
/
serious
/
shareware
/
programming
/
aros
/
exec
/
setexcept.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-12
|
2KB
|
96 lines
/*
(C) 1995-96 AROS - The Amiga Replacement OS
$Id: setexcept.c,v 1.4 1996/08/13 13:56:08 digulla Exp $
$Log: setexcept.c,v $
Revision 1.4 1996/08/13 13:56:08 digulla
Replaced __AROS_LA by __AROS_LHA
Replaced some __AROS_LH*I by __AROS_LH*
Sorted and added includes
Revision 1.3 1996/08/01 17:41:19 digulla
Added standard header for all files
Desc:
Lang:
*/
#include <exec/execbase.h>
#include <aros/libcall.h>
/*****************************************************************************
NAME */
#include <clib/exec_protos.h>
__AROS_LH2(ULONG, SetExcept,
/* SYNOPSIS */
__AROS_LHA(ULONG, newSignals, D0),
__AROS_LHA(ULONG, signalSet, D1),
/* LOCATION */
struct ExecBase *, SysBase, 52, Exec)
/* FUNCTION
Change the mask of signals causing a task exception.
INPUTS
newSignals - Set of signals causing the exception.
signalSet - Mask of affected signals.
RESULT
Old mask of signals causing a task exception.
NOTES
EXAMPLE
BUGS
SEE ALSO
AllocSignal(), FreeSignal(), Wait(), SetSignal(), Signal()
INTERNALS
HISTORY
******************************************************************************/
{
__AROS_FUNC_INIT
struct Task *me;
ULONG old;
/* Get pointer to current task */
me=SysBase->ThisTask;
/* Protect mask of sent signals and task lists */
Disable();
/* Get returncode */
old=me->tc_SigExcept;
/* Change exception mask */
me->tc_SigExcept=(old&~signalSet)|(newSignals&signalSet);
/* Does this change include an exception? */
if(me->tc_SigExcept&me->tc_SigRecvd)
{
/* Yes. Set the exception flag. */
me->tc_Flags|=TF_EXCEPT;
/* Are taskswitches allowed? (Don't count own Disable() here) */
if(SysBase->TDNestCnt>=0||SysBase->IDNestCnt>0)
/* No. Store it for later. */
SysBase->AttnResched|=0x80;
else
/* Switches are allowed. Force a rescedule. */
Switch();
}
Enable();
return old;
__AROS_FUNC_EXIT
}